package com.aix.demo.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;

public class DBHelper extends SQLiteOpenHelper {
	
	private static final String TAG = "DBHelper";
	
	private static final String DB_NAME = "android_misc_demo.db";
	
	private static final int VERSION = 2;
	
	public DBHelper(Context context) {
		super(context, DB_NAME, null, VERSION);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL("CREATE TABLE IF NOT EXISTS t_person (id integer primary key autoincrement, name text)"); 
		
		Log.e(TAG, "onCreate executed");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("CREATE TABLE IF NOT EXISTS t_course (id integer primary key autoincrement, name text)"); 
		
		Log.e(TAG, "onUpgrade executed");
	}

}
